package com.gupaoedu.xin.vip.pattern.factory.simplefactory;

import com.gupaoedu.xin.vip.pattern.factory.ICourse;
import com.gupaoedu.xin.vip.pattern.factory.JavaCourse;

public class CourseFactory {
    public static void main(String[] args) {
        System.out.println("------------");
        ICourse course = new JavaCourse();
        course.record();

        System.out.println("------------");
        SimpleFactory factory = new SimpleFactory();
        ICourse coursef=factory.create("java");
        coursef.record();

        System.out.println("------------");
        SimpleFactory factory1=new SimpleFactory();
        ICourse course2= factory1.create("com.gupaoedu.xin.vip.pattern.factory.","JavaCourse");
        course2.record();

        System.out.println("------------");
        SimpleFactory factory2 = new SimpleFactory();
        ICourse course3 = factory2.create(JavaCourse.class);
        course3.record();

    }
}
